<template>
  <div class="page">
    <!-- tab1 -->
		<app-tab1></app-tab1>
    <div class="list_box" style="top:45px">
      <div class="tip" style="margin-top:15px">
       请注意：请根据培训地点选择其中合适一个报名！
      </div>
      <van-list v-model="loading" :finished="finished" @load="getList" style="margin-bottom: 49px;">
        <router-link v-for="(item,index) in list" :key="index" :to="'/sign?id='+item.id" class="list_item">
          <div class="titBox titBox1">
           <div class="tit">{{item.code}}</div>
           <span class="listLabel listLabel_1" v-if="item.status=='已报名'">{{item.status}}</span>
           <span class="listLabel listLabel_2" v-if="item.status=='请假'">{{item.status}}</span>
           <span class="listLabel listLabel_3" v-if="item.status=='未报名'">{{item.status}}</span>
         </div>
         <div class="titBox">
           <div class="tit">{{item.title}}</div>
         </div>
         <p>{{item.start}} - {{item.end}}</p>
         <p>报名期限：{{item.deadline}}</p>
        </router-link>
        <div class="finished" v-if="finished">加载完毕</div>
      </van-list>
    </div>
  </div>
</template>

<script>
import { Dialog } from "vant";
import tab1 from '@/components/common/tab1';
export default {
  data() {
    return {
      list:[],
      loading: false,
      finished: false
    };
  },
  mounted: function() {
    maxusJSB.tojson({title:"培训中心",left:"关闭"})
   
  },
		components:{
			"app-tab1":tab1
		},
  methods: {
    // 请求列表
    getList() {
      this.$http
        .get("?key=&request=front&operation=classes&client=1&by=admin&user_id="+this.getUserID+"&_="+Date.parse(new Date()))
        .then(response => {
          if(response.ret==1){
            this.list=response.data
            this.loading=false
            this.finished=true
          }
        });
    }
  }
};
 // 统计
    (function(g, d, s, t) {
		g['_cts'] = g['_cts'] || {};
		g['_cts'][t] = g['_cts'][t] || {};
		g[t] = g[t] || function() {
			(g[t].c = g[t].c || []).push(arguments);
		}
		var c = d.createElement(s),
			h = d.getElementsByTagName(s)[0];
		c.src = '//c.saicmaxus.com/dmp/t.js';
		h.parentNode.insertBefore(c, h);
	})(window, document, 'script', 'pilot');

	pilot('set', 'siteId', 'CCS82280');
	pilot('set', 'accountId', 'pilot');
	pilot('set', 'baseUrl', 'https://trk.maxuscloud.com/');
	pilot('track', 'pageview','index2');
</script>